package com.rxtxdemo.rxtxdemo;

import com.rxtxdemo.rxtxdemo.demo.SerialService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;


@SpringBootApplication
@EnableAsync  //开启异步执行
@Slf4j
public class RxtxdemoApplication implements CommandLineRunner {

    @Autowired
    private SerialService serialService;

    public static void main(String[] args) {
        SpringApplication.run(RxtxdemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        serialService.test();
    }

//    @PreDestroy
//    public void  destory(){
//        SerialPortutil serialPortutil= SerialPortutil.getSerialPortutil();
//    }
}
